<?php

namespace IDock\Insurance\TPIC\Request;

use IDock\Insurance\TPIC\Request\AllTPICRequest;
use IDock\Insurance\TPIC\Response\ElecPolicyDownloadResponse;
use IDock\Insurance\TPIC\Response\UploadFileResponse;
use IDock\Insurance\TPIC\Response\VehicleModelResponse;
use IDock\Insurance\TPIC\TPICEnums;
use IDock\Visitor\EPolicyDownloadVisitor;
use IDock\Visitor\UploadFileVisitor;
use IDock\Visitor\VehicleModelVisitor;

/**
 * 电子保单下载
 */
class ElecPolicyDownloadRequest extends AllTPICRequest
{
    protected $response = ElecPolicyDownloadResponse::class;

    protected $urlTip = '电子保单下载';

    public $route = 'downElecPolicy';

    public $outLogs = false;

    /**
     * @var EPolicyDownloadVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        $arr = [
            'risk' => [
                'policyNo' => $this->visitor->policyNo,
            ],
            'elecDocument' => [
                'electronInvoice' => '0'
            ]
        ];
        if(isset($this->visitor->argc['orderNo'])){
            $arr = [
                'fcProduct' => [
                    'fcPolicyNo' => $this->visitor->argc['orderNo'] ?? '',
                ]
            ];
        }
        return $arr;
    }
}
